﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Application.Entity;

/// <summary>
/// 设备列表
/// </summary>
[SugarTable("DeviceInfo", "设备信息")]
public class DeviceInfo : EntityBaseData
{
    /// <summary>
    /// 设备名称
    /// </summary>
    [SugarColumn(ColumnName = "DeviceName", ColumnDescription = "设备名称", Length = 100)]
    public string DeviceName { get; set; }

    /// <summary>
    /// 设备编号
    /// </summary>
    [SugarColumn(ColumnName = "DeviceNo", ColumnDescription = "设备编号", Length = 50)]
    public string DeviceNo { get; set; }

    /// <summary>
    /// 描述
    /// </summary>
    [SugarColumn(ColumnName = "Description", ColumnDescription = "描述", Length = 500)]
    public string Description { get; set; }

    /// <summary>
    /// 标签
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public List<string> Tags { get; set; }

    /// <summary>
    /// 地址
    /// </summary>
    [SugarColumn(ColumnName = "Address", ColumnDescription = "地址", Length = 200)]
    public string Address { get; set; }

    /// <summary>
    /// 位置
    /// </summary>
    [SugarColumn(ColumnName = "Position", ColumnDescription = "位置", Length = 100)]
    public string Position { get; set; }

    /// <summary>
    /// 位置类型
    /// </summary>
    [SugarColumn(ColumnName = "DevicePositionType", ColumnDescription = "位置类型")]
    public DevicePositionType DevicePositionType { get; set; }

    /// <summary>
    /// 图片URL
    /// </summary>
    [SugarColumn(ColumnName = "ImageUrl", ColumnDescription = "图片URL", Length = 200)]
    public string ImageUrl { get; set; } = "";

    /// <summary>
    /// 设备网关
    /// </summary>
    [SugarColumn(ColumnName = "DeviceGateWayId", ColumnDescription = "设备网关ID")]
    public long DeviceGateWayId { get; set; }

    [Navigate(NavigateType.OneToOne, nameof(DeviceGateWayId))]
    [SugarColumn(IsIgnore = true)]
    public DeviceGateWay DeviceGateWay { get; set; }

    /// <summary>
    /// 设备模板
    /// </summary>
    [SugarColumn(ColumnName = "DeviceTemplateInfoId", ColumnDescription = "设备模板ID")]
    public long DeviceTemplateInfoId { get; set; }

    [Navigate(NavigateType.OneToOne, nameof(DeviceTemplateInfoId))]
    [SugarColumn(IsIgnore = true)]
    public DeviceTemplateInfo DeviceTemplateInfo { get; set; }

    /// <summary>
    /// 设备从机关系DTO列表
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(DeviceRelSlave.DeviceInfoId))]
    [SugarColumn(IsIgnore = true)]
    public List<DeviceRelSlave> DeviceRelSlaves { get; set; }

    /// <summary>
    /// 直属机构Id
    /// </summary>
    [SugarColumn(ColumnDescription = "直属机构Id")]
    public long OrgId { get; set; }

    /// <summary>
    /// 直属机构
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(OrgId))]
    public SysOrg SysOrg { get; set; }
}